home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bitmap / colorset.bas < prev    next >
BASIC Source File  |  1995-05-09  |  683b  |  36 lines

  1. '-- sets the fg/bg colors of a control
  2. Sub ColorSet (Ctl As Control)
  3.  
  4. '-- load the form
  5. Load ColorSetForm
  6. ColorSetForm.FG.BackColor = Ctl.ForeColor
  7. ColorSetForm.BG.BackColor = Ctl.BackColor
  8.  
  9. ColorSetForm.Show MODAL
  10.  
  11. Ctl.ForeColor = ColorSetForm.FG.BackColor
  12. Ctl.BackColor = ColorSetForm.BG.BackColor
  13.  
  14. Unload ColorSetForm
  15.  
  16. End Sub
  17.  
  18. Function GetBValue (rgbColor As Long) As Integer
  19.  
  20. GetBValue = rgbColor And &HFF0000 \ &H10000
  21.  
  22. End Function
  23.  
  24. Function GetGValue (rgbColor As Long) As Integer
  25.  
  26. GetGValue = Int(rgbColor And &HFF00& \ &H100&)
  27.  
  28. End Function
  29.  
  30. Function GetRValue (rgbColor As Long) As Integer
  31.  
  32. GetRValue = rgbColor And &HFF&
  33.  
  34. End Function
  35.  
  36.